package com.jv.linearlayoutlearning;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    private Button jumpToRelativeLayout;
    private Button jumpToTableLayout;
    private Button jumpToFrameLayout;
    private Button jumpToGridLayout;
    private Button jumpToAbsoluteLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        find();
        init();
    }
    void find() {
        jumpToRelativeLayout = findViewById(R.id.jumpToRelativeLayout);
        jumpToTableLayout = findViewById(R.id.jumpToTableLayout);
        jumpToFrameLayout = findViewById(R.id.jumpToFrameLayout);
        jumpToGridLayout = findViewById(R.id.jumpToGridLayout);
        jumpToAbsoluteLayout = findViewById(R.id.jumpToAbsoluteLayout);
    }
    void init() {
        jumpToRelativeLayout.setOnClickListener(view -> startActivity(new Intent(MainActivity.this,RelativeLayoutLeaning.class)));
        jumpToTableLayout.setOnClickListener(view -> startActivity(new Intent(MainActivity.this,TableLayoutLeaning.class)));
        jumpToFrameLayout.setOnClickListener(view -> startActivity(new Intent(MainActivity.this,FrameLayoutLeaning.class)));
        jumpToGridLayout.setOnClickListener(view -> startActivity(new Intent(MainActivity.this,GridLayoutLeaning.class)));
        jumpToAbsoluteLayout.setOnClickListener(view -> startActivity(new Intent(MainActivity.this,AbsoluteLayoutLeaning.class)));
    }
}